import requests, json
from common.consts import USER_INFO_API_URL, API_HEADER

def get_user_info_api(uid):
    url = USER_INFO_API_URL + f'?uid={uid}'
    response = requests.get(url, headers=API_HEADER)
    data = json.loads(response.text)
    result = None
    if data['ok']:
        result = data['data']['user']
    return result